<?php
class Zenddn_Plugin_DefaultPermission extends Zend_Controller_Plugin_Abstract{
    
    public function preDispatch(Zend_Controller_Request_Abstract $request){
        $auth = Zend_Auth::getInstance();
        
        $module = $request->getModuleName();
        $controller = $request->getControllerName();
        $action = $request->getActionName();
        
        $arrController = array('account');
        $arrAction = array('index', 'logout', 'change-password', 'point');
        
        if(in_array($controller, $arrController) && in_array($action, $arrAction)){
            if(!$auth->hasIdentity()){
                $request->setControllerName('account');
                $request->setActionName('login');
            }
        }
    }
}